package guda.stark.biz.form;

import guda.stark.biz.util.ArrayUtil;
import guda.stark.dal.dataobject.AdminDO;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;


public class AdminForm {
    @NotNull(message = "不能为空")
    @Size(min=1,max=30,message = "长度在0到30个字符之间")
    private String loginName;
    @NotNull(message = "不能为空")
    private String loginPassword;
    @NotNull(message = "不能为空")
    private String[] roleName;
    @Size(min=0,max=18,message = "长度在0到18个字符之间")
    private String certNo;
    @Size(min=0,max=11,message = "长度为11个字符")
    private String phone;
    @Size(min=0,max=16,message = "长度在0到16个字符之间")
    private String weixin;
    @Size(min=0,max=30,message = "长度在0到30个字符之间")
    private String qq;
    @Size(min=0,max=60,message = "长度在0到60个字符之间")
    private String email;
    private Integer adminStatus;
    @Size(min=1,max=10,message = "长度在0到10个字符之间")
    private String realName;

    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName;
    }

    public AdminDO toDO() {
        AdminDO adminDO = new AdminDO();
        adminDO.setLoginName(loginName);
        adminDO.setLoginPassword(loginPassword);
        adminDO.setCertNo(certNo);
        adminDO.setPhone(phone);
        adminDO.setQq(qq);
        adminDO.setEmail(email);
        adminDO.setRoleName(ArrayUtil.array2String(roleName));
        adminDO.setWeixin(weixin);
        adminDO.setAdminStatus(adminStatus);
        adminDO.setRealName(realName);
        return adminDO;
    }

    public String getLoginName() {
        return loginName;
    }

    public void setLoginName(String loginName) {
        this.loginName = loginName;
    }

    public String getLoginPassword() {
        return loginPassword;
    }

    public void setLoginPassword(String loginPassword) {
        this.loginPassword = loginPassword;
    }

    public String[] getRoleName() {
        return roleName;
    }

    public void setRoleName(String[] roleName) {
        this.roleName = roleName;
    }

    public String getCertNo() {
        return certNo;
    }

    public void setCertNo(String certNo) {
        this.certNo = certNo;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getWeixin() {
        return weixin;
    }

    public void setWeixin(String weixin) {
        this.weixin = weixin;
    }

    public String getQq() {
        return qq;
    }

    public void setQq(String qq) {
        this.qq = qq;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public Integer getAdminStatus() {
        return adminStatus;
    }

    public void setAdminStatus(Integer adminStatus) {
        this.adminStatus = adminStatus;
    }
}
